<#include '/admin/header.html' >
<div class="main">
	<div class="shadowBoxWhite tableDiv">
		<table class="easyui-datagrid"
			data-options="url:'returnOrder!returnsListJson.do',pageList: [10,15,19,30],pageSize:${pageSize},fitColumns:'true'"
			pagination="true">
			<thead>
				<tr>
					<th data-options="field:'ordersn',width:100">订单号</th>
					<th data-options="field:'membername',width:100">会员名</th>
					<th data-options="field:'isState',width:200"
						formatter="formatisState">状态</th>
					<th data-options="field:'istype',width:100"
						formatter="formatisType">类型</th>
					<th data-options="field:'add_time',width:100"
						formatter="formatAdd_time">申请日期</th>
					<th data-options="field:'action',width:100,align:'center'"
						formatter="formatOperation">操作</th>
				</tr>
			</thead>
		</table>
	</div>
</div>

<script type="text/javascript">
	function formatOperation(value, row, index) {
		var val = '<a href="printTmpl!edit.do?prt_tmpl_id=' + row.prt_tmpl_id
				+ '" ><img class="modify" src="images/transparent.gif" ></a>';
		return val;
	}

	function formatisState(value, row, index) {
		var val;
		if (row.state == 0) {
			val = "未处理";

		} else if (row.state == 1) {
			if (row.type == 1) {
				val = "退货已拒绝";
			}
			if (row.type == 2) {
				val = "换货已拒绝";
			}

		} else if (row.state == 2) {
			if (row.type == 1) {
				val = "退货申请审核通过，等待客户将货品退回";
			}
			if (row.type == 2) {
				val = "换货申请审核通过，等待客户将货品退回";
			}

		} else if (row.state == 3) {
			if (row.type == 1) {
				val = "客户退回货品已收到，等待退款";
			}
			if (row.type == 2) {
				val = "换货已收货，新货已发出";
			}

		} else if (row.state == 4) {
			if (row.type == 1) {
				val = "退货流程完成";
			}
			if (row.type == 2) {
				val = "换货流程完成";
			}

		}
		return val;
	}

	function formatisType(value, row, index) {
		var val;
		if (row.type == 1) {
			val = "退货";
		} else if (row.type == 2) {
			val = "换货";
		}
		return val;
	}

	function formatAdd_time(value, row, index) {
		return getFormatDateByLong(value, "yyyy-MM-dd hh:mm:ss");
	}
</script>
<#include '/admin/footer.html' >


